<style>
#cc{
	margin-left: 20px;
}
#cc li {
	height: 30px;
	width: 250px;
	float: left;
	line-height: 30px;
}
</style>
<script>
$(document).ready(function(){
	
	//控制全选按钮状态
	$('.cc').click(function(){
		var a = $('.cc');
		var str = '';

		var selCount=0;
		var unSelCount=0;
		for(var i=0;i<a.length;i++){
			if(a[i].checked==true){
				selCount++;
			}
			if(a[i].checked==false){
				unSelCount++;
			}
			if(selCount==a.length){
				$('#all').attr('checked','checked');
			}
			if(unSelCount>0){
				$('#all').removeAttr('checked');
			}
		}
	})

	$('#allno').click(function(){
		var a  = $('.cc');
		var str = '';

		var selCount=0;
		var unSelCount=0;
		for(var i=0;i<a.length;i++){
			if(a[i].checked==true){
				selCount++;
			}
		}
		if(selCount != 0 ){
			$('#all').removeAttr('checked');
		}else{
			$('#all').attr('checked','checked');
		}
	})
}); 
</script>
<div class="pageContent">
	<form action="__URL__/setUser" method="post" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
		<input type="hidden" name="groupId" VALUE="{$Think.get.id}" />
		<div class="pageFormContent" layoutH="58">
			<volist id="item" name="userList">
			<!-- <div class="unit">
				<input type="checkbox" name="groupUserId[]" class="cc" value="{$key}" <?php echo in_array($key, $groupUserList) ? "checked" : "" ?>/>{$item}
			</div> -->
			<ul id="cc">
				<li>
					<input type="checkbox" name="groupUserId[]" class="cc" value="{$key}" <?php echo in_array($key, $groupUserList) ? "checked" : "" ?>/>{$item}
				</li>
			</ul>
			</volist>
		</div>
		<div class="formBar">
			<label style="float:left"><input type="checkbox" class="checkboxCtrl" group="groupUserId[]" id="all" />全选</label>
			<ul>
			<!--
			<li><div class="button"><div class="buttonContent"><button type="button" class="checkboxCtrl" group="groupUserId[]" selectType="all">All check</button></div></div></li>
			<li><div class="button"><div class="buttonContent"><button type="button" class="checkboxCtrl" group="groupUserId[]" selectType="none">All uncheck</button></div></div></li>
			-->
			<li><div class="button"><div class="buttonContent"><button type="button" id="allno" class="checkboxCtrl" group="groupUserId[]" selectType="invert">反选</button></div></div></li>
			<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
			<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
			</ul>
		</div>
	</form>
</div>


